package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.time.LocalDate;
import java.util.List;

/**
 * 销售订单实体类
 */
@TableName("t_sale")
@ApiModel(value = "销售信息实体类",description = "封装销售订单相关信息")
public class SaleBean {
    /**编号**/
    @ApiModelProperty("编号")
    @TableId(value = "pk_saleId",type = IdType.AUTO)
    private Integer id;
    /**客户名称**/
    @ApiModelProperty("客户名称")
    @TableField("s_client")
    private String client;
    /**销售员**/
    @ApiModelProperty("销售员")
    @TableField("s_person")
    private String person;
    /**销售日期**/
    @ApiModelProperty("销售日期")
    @TableField("s_date")
    private LocalDate date=LocalDate.now();
    /**订单总价**/
    @ApiModelProperty("订单总价")
    @TableField("s_total")
    private Integer total;
    /**收货地址**/
    @ApiModelProperty("收货地址")
    @TableField("s_address")
    private String address;
    /**销售订单明细集合**/
    @ApiModelProperty("销售订单明细集合")
    @TableField(exist = false)
    private List<SaleDetailBean> saleDetailList;

    public SaleBean() {
    }

    public SaleBean(String client, String person, String address) {
        this.client = client;
        this.person = person;
        this.address = address;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getClient() {
        return client;
    }

    public void setClient(String client) {
        this.client = client;
    }

    public String getPerson() {
        return person;
    }

    public void setPerson(String person) {
        this.person = person;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public List<SaleDetailBean> getSaleDetailList() {
        return saleDetailList;
    }

    public void setSaleDetailList(List<SaleDetailBean> saleDetailList) {
        this.saleDetailList = saleDetailList;
    }

    @Override
    public String toString() {
        return "SaleBean{" +
                "id=" + id +
                ", client='" + client + '\'' +
                ", person='" + person + '\'' +
                ", date=" + date +
                ", total=" + total +
                ", address='" + address + '\'' +
                ", saleDetailList=" + saleDetailList +
                "}\n";
    }
}
